package com.harmontronics.hanma.paas.paas.domain.iam.entity.valueobject;

import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.List;

public enum UserGroupComponentEnum {

    ORG(10001L, Lists.newArrayList(10002L)),
    REPORT(200001L, Lists.newArrayList(20002L, 20201L)),
    SPARE(60001L, Lists.newArrayList(60002L)),
    MOULD(200001L, Lists.newArrayList(200002L, 200201L)),
    CLAMP(210001L, Lists.newArrayList(210002L, 210201L)),
    ;

    private Long id;
    private List<Long> cascadeIdList;

    UserGroupComponentEnum(Long id, List<Long> cascadeIdList) {
        this.id = id;
        this.cascadeIdList = cascadeIdList;
    }

    public static List<Long> getCascadeIdListWithId(Long id) {
        for (UserGroupComponentEnum value : UserGroupComponentEnum.values()) {
            if (value.id.equals(id)) {
                return value.cascadeIdList;
            }
        }
        return new ArrayList<>();
    }
}
